<template>
  <div class="k-box">
    <van-nav-bar title="选择科室" left-text="" left-arrow @click-left="onClickLeft" />
    <div class="k-top">
      <div class="kt-left">
        <img :src="list.img" alt="" />
      </div>
      <div class="kt-right">
        <div class="kt-title">{{ list.hospital }}</div>
        <div class="kt-bt">
          <span>三级乙等</span>
          <span>公立</span>
          <span>综合</span>
        </div>
        <div class="kt-address">地址：{{ list.address }}</div>
      </div>
    </div>
    <div class="k-main">
      <div class="km-title">科室列表</div>
      <div class="km-tab">
        <!-- <van-sidebar v-model="active" class="tab-left">
          <van-sidebar-item title="外科">
            <div>神经外科</div>
            <div>神经外科中心</div>
            <div>周围神经外科</div>
          </van-sidebar-item>
          <van-sidebar-item title="" style="height: 1355px;" />
        </van-sidebar> -->
        <ul>
          <li>外科</li>
        </ul>
        <div class="km-tab-right">
          <ul v-for="(item,index) in data" :key="index">
            <li @click="tox(index)" :class="liindex === index ? 'li' : ''">{{ item }}</li>
            <!-- <li>神经外科</li>
            <li>神经外科中心</li>
            <li>周围神经外科</li> -->
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import axios from 'axios'
import { useRoute } from 'vue-router'
import { useRouter } from 'vue-router';
const router = useRouter()
const active = ref(0)
const data = ref(['神经外科', '神经外科中心', '周围神经外科'])
const route = useRoute()
const list = ref([])
const id = ref(route.query.id)
const listdata = async () => {
  await axios.get('/api/registration', { params: { id: id.value } }).then((res) => {
    console.log(res.data.data[0])
    list.value = res.data.data[0]
  })
}
listdata()
const liindex = ref(0)
const tox=(index)=>{
  console.log(index)
  liindex.value = index
  router.push('/xzhy')
}
const onClickLeft = () => history.back()
</script>

<style scoped>
.k-box {
  width: 100%;
  height: 1332px;
  background-color: #f4f4f4;
}
.k-top {
  width: 100%;
  height: 180px;
  background-color: #fff;
  margin-top: 20px;
  display: flex;
}
.kt-left > img {
  width: 80px;
  height: 80px;
  margin: 30px;
  border-radius: 20px;
}
.kt-title {
  font-size: 26px;
  font-weight: 600;
  margin-top: 30px;
  margin-bottom: 10px;
}
.kt-bt {
  margin-bottom: 20px;
}
.kt-bt > span {
  padding: 5px 10px;
  border: 1px solid #00c791;
  color: #00c791;
  border-radius: 10px;
  margin-right: 15px;
}
.kt-address {
  font-size: 23px;
  color: #a7a7a7;
}
.k-main {
  width: 100%;
  height: 1020px;
  overflow: auto;
  background-color: #fff;
  margin-top: 20px;
}
.km-title {
  width: 100%;
  height: 80px;
  line-height: 80px;
  padding-left: 30px;
  font-size: 26px;
  font-weight: 600;
  border-bottom: 1px solid #e5e5e5;
}
.tab-left {
  width: 50%;
}
.km-tab{
  width: 100%;
  display: flex;
}
.km-tab>ul{
  width: 50%;
  height: 940px;
  background-color: #F4F4F4;
}
.km-tab>ul>li{
  width: 100%;
  height: 80px;
  line-height: 80px;
  padding-left: 30px;
  font-size: 23px;
  font-weight: 600;
  color: #00D2A7;
  background-color: #fff;
}
.km-tab-right{
  width: 50%;
}
.km-tab-right>ul>li{
  height: 80px;
  padding-left: 30px;
  line-height: 80px;
  font-size: 25px;
}
.li{
  color: #00D2A7;
}
</style>
